from netfilterqueue import NetfilterQueue

from packet_correctness import *

merger_1_2 = Merger(1, 2)
packet_correctness_merger_1_2 = PacketCorrectness(merger_1_2, 11, 'Merger-1-2')

_pkt = b'E\x00\x00X\x00\x01\x00\x00@\x06F\x13\xac\n\x01\x02$\x91b\xef\x1f\x90M\xf1\x00\x00\x00\x00\x00\x00\x00\x00P' \
       b'\x02 \x00\xf6\xc6\x00\x00abcdefffffffffffffff\x00\x00\x00\x01\x00\x00\x00\n\x00\x00\x00\x0b\xae\xa9;\x7f' \
       b'=\xf1s\xe8\xe4\x19\xc8\xf1-#\x17& '


def print_and_accept(pkt):
    # out_pkts = packet_correctness_merger_1_2.merge(_pkt)
    # pkt.set_payload(out_pkts[0])
    pkt.accept()


queue = NetfilterQueue()
queue.bind(1, print_and_accept, max_len=8192 * 20)
try:
    queue.run()
except KeyboardInterrupt:
    queue.unbind()
